package com.crm.system.service.impl.customerManager;

import com.alibaba.fastjson.JSONObject;
import com.crm.model.entity.customerManager.CustomerContactPerson;
import com.crm.model.entity.customerManager.CustomerPoolCompany;
import com.crm.model.entity.sys.permissionManagement.SysCompany;
import com.crm.service.customerManager.CustomerContactPersonDbService;
import com.crm.system.service.customerManager.CustomerContactPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @ Author ：pym
 * @ Date   ：2021/3/5 9:15
 */
@Service
public class CustomerContactPersonServiceImpl implements CustomerContactPersonService {
    @Autowired
    CustomerContactPersonDbService customerContactPersonDbService;

    /**
     * 用户模块-客户管理-我的客户-跟进-客户联系人回显
     * @Author pym
     * @Date  2021/3/5 9:19
     * @param status       -- 0 查询全部联系人和手机号 1 模糊搜索联系人和手机号
     * @param customerId   --客户id
     * @param contactName  --联系人姓名
     * @return {@link {java.util.List<com.crm.model.entity.customerManager.CustomerContactPerson>}}
     */
    @Override
    public List<CustomerContactPerson> selectCustomerContactPersons(String status, String customerId, String contactName) {
        return customerContactPersonDbService.selectCustomerContactPersons(customerId, "0".equals(status) ? "" : contactName);
    }

    /**
     * 查询客户下客户联系人
     * @Author pym
     * @Date  2021/4/14 15:55
     * @param customerId
     * @return {@link {java.util.List<com.crm.model.entity.customerManager.CustomerContactPerson>}}
     */
    @Override
    public List<CustomerContactPerson> selectCustomerContactPersonList(String customerId) {
        return customerContactPersonDbService.selectCustomerContactPersonList(customerId);
    }
}
